﻿@model IEnumerable<Occupie.ViewModels.OfferViewModels.OfferAllViewModel>

@(Html.Kendo()
    .Grid<Occupie.ViewModels.OfferViewModels.OfferAllViewModel>().EnableCustomBinding(true)
    .Name("offers")
    .BindTo(Model)
    .Columns(columns =>
    {
        columns.Bound(model => model.Title).Sortable(true).Title("Име");
        columns.Bound(model => model.EmployerTitle).Sortable(true).Title("Работодател");
        columns.Bound(model => model.DailyWorkTime).Sortable(true).Title("Работно време");
        columns.Bound(model => model.OfferLevel).Sortable(true).Title("Ниво");
        columns.Bound(model => model.Id).ClientTemplate(@Html.ActionLink("Детайли", "Details", "Offer", new { id = "#=Id#" }, null).ToHtmlString()).Title("Детайли");
    })

    .Sortable(
    sort =>
    {
        sort.Enabled(true);
        sort.AllowUnsort(true);
        sort.SortMode(GridSortMode.SingleColumn);
    })
    .Resizable(resize => resize.Columns(false))
    .Navigatable()
            .DataSource(data =>
            {
                data.Ajax().Read(read => read.Action("ReadLatestOffers", "Offer"));
            }
            )
    )

